package com.ktjy.pojo.goods;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serial;
import java.io.Serializable;

/**
 * 商品
 *
 * @author LILIBO
 * @since 2023-04-25
 */
@Tag(name = "商品", description = "商品数据")
@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("`product`")
public class Product implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 商品ID
     */
    @Schema(description = "商品ID")
    @TableId(type = IdType.AUTO) // 使用自增ID
    // @TableId(type = IdType.ASSIGN_ID) // 使用雪花算法生成ID
    private Long id;

    /**
     * 商品名称
     */
    @Schema(description = "商品名称")
    private String name;

    /**
     * 商品标题
     */
    @Schema(description = "商品标题")
    private String title;

    /**
     * 商品图片
     */
    @Schema(description = "商品图片")
    private String img;

    /**
     * 商品描述
     */
    @Schema(description = "商品描述")
    private String detail;

    /**
     * 商品价格
     */
    @Schema(description = "商品价格")
    private Double price;

    /**
     * 商品库存
     */
    @Schema(description = "商品库存")
    private Integer stock;

}
